﻿{% extends 'theme/default/template/master.html' %}

{%load comm_extras %}

{% block title %} {{movie.title}} -  {% endblock %}

{% block head_soruce %}
	<link type="text/css" rel="stylesheet" href="/static/theme/default/css/index.css">
	<link type="text/css" rel="stylesheet" href="/static/theme/default/css/play.css">
	<script src="/static/theme/default/js/play.js" type="text/javascript"></script> 
{% endblock %}

{% block main_content %}
{%if movie%}
	<input type="hidden" value="{{movie.id}}" id="movie_id" />
	<h1>{{movie.title}}</h1>
	<div class="player mainContent">
	{%if play_url.play_code %}
		<div class="pager">
			播放窗口大小：<span class="sbtnCurrent" onclick="player.changeWidth(this);">默认</span> 
			<span class="sbtn" onclick="player.changeWidth(this, 600);">中等</span> 
			<!-- <span class="sbtn" onclick="player.changeWidth(this, 900);">极大</span> -->
		</div>
		<div id="playerWrap">{{play_url.play_code|safe}}</div>
		{% if play_url.source_url %}
		<p>来源: <a title="{{play_url.source}}" href="{{play_url.source_url}}" target="_blank">{{play_url.source_url}}</a></p>
		{% endif %}
	{% else %}
		<h3 style="color:red;">很抱歉，该片暂时还没添加播放地址</h3>
	{% endif %}
	    <script type="text/javascript">
	        var status_text = '{{movie.title}} - @卜电影  #在线播放#: ' + location.href;
	        document.write('<iframe  frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?url=%url%&appkey=2783228883&type=5" width="103" height="24"></iframe>'.replace(/%url%/,encodeURIComponent(status_text)));
	    </script>
	    {% if user_info %}
        <h2>我来说两句</h2>
        <form class="clearfix">
        	<span id="reply_comment_to" class="hide"></span>
            <textarea id="comment_body" rows="3" cols="80"></textarea>
            <input id="comment_btn" type="button" value="评论" />
            <span class="retweet_checkbox"><input id="retweet" type="checkbox" /> <label for="retweet">同时转发到我的微博</label></span>
            <input type="hidden" value="" id="reply_comment_id" />
        </form>
        {% else %}
        <p><span class="login"><img src="/common/images/tsina.gif" /> <a href="{% url login %}">登陆微博，发表评论</a></span></p>
        {% endif %}
        <h2><a href="#comments" name="comments">评论列表</a> 
        [<a href="http://api.t.sina.com.cn/bodianying/statuses/{{movie.status_id}}" target="_blank">查看微博</a>]
        <a href="javascript:list_comments();">刷新</a>
        </h2>
        <div id="comments_loading"><img src="/static/common/images/loading.gif" />评论加载中...</div>
        <ul id="comments" class="comments">
          <li></li>
        </ul>
	</div>
	<div class="aside clearfix">
		<div class="sideBox">
			<h2>电影信息：</h2>
			<div class="movieinfo">
				 <div class="info">
					 <ul>
						 <li><label>豆瓣：</label><span class="allstar{{movie.douban_rating|rating_star}}"><em class="rating_nums">{{movie.douban_rating}}</em></span></li>
						 {% if movie.mtime_rating %}<li><label>Mtime:</label><span class="allstar{{movie.mtime_rating|rating_star}}"><em class="rating_nums">{{movie.mtime_rating}}</em></span></li>{% endif %}
						 {% if movie.imdb_rating %}<li><label>IMDB:</label><span class="allstar{{movie.imdb_rating|rating_star}}"><em class="rating_nums">{{movie.imdb_rating}}</em></span></li>{% endif %}
						 <li><label>导演:</label> {{movie.director}}</li>
						 <li><label>主演:</label> {{movie.stars}}</li>
						 <li><label>上映日期:</label> {{movie.launch_date}}</li>
						 <li><label>制片地区:</label> {{movie.area}}</li>
						 <li><label>其他名称:</label> {{movie.other_title}}</li>
						 <li><label>电影信息:</label>
						     {% if movie.douban %}<a title="{{movie.douban.source}}" href="{{movie.douban.url}}" target="_blank">{{movie.douban.source}}</a>{% endif %}
						     {% if movie.mtime %} | <a title="{{movie.mtime.source}}" href="{{movie.mtime.url}}" target="_blank">{{movie.mtime.source}}</a>{% endif %}
						     {% if movie.imdb %} | <a title="{{movie.imdb.source}}" href="{{movie.imdb.url}}" target="_blank">{{movie.imdb.source}}</a>{% endif %}
						 </li>
						 <li><label>Tag:</label>
							{%for tag_name in movie.tag_names %}
								<a target="_blank" href="{%url movie-list-by-tag-name tag_name %}">{{tag_name}}</a>
							{%endfor%}
						 </li>
					 </ul>
					 <div class="intro"><label>内容简介:</label><br/> {{movie.introduction|rn_to_br|safe}}</div>
				 </div>
			</div>
		</div>
		<div class="sideBox">
			<h2>其他播放地址：</h2>
			<div class="otherPlayurl">
			{%for playurl in playurls %}
				{%ifnotequal playurl.id play_url.id%}
				<a href="{%url play-movie movie.id %}?pu={{playurl.id}}" class="playbtn">
					<img src="/static/common/images/source/{{playurl.source}}.gif" />播放
				</a>
				{%endifnotequal%}
			{%endfor%}
			</div>
		</div>
	</div>
{%else%}
	<div>电影不存在</div>
{%endif%}
{% endblock %}